# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=soapyremote
_pkgname=SoapyRemote
pkgver=0.5.2
_gitver=soapy-remote-$pkgver
pkgrel=1
pkgdesc='Use any Soapy SDR remotely'
arch=('loong64' 'x86_64')
url='https://github.com/pothosware/SoapyRemote'
license=('custom:Boost')
depends=('soapysdr' 'avahi')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$_gitver.tar.gz")
sha512sums=('55841f248c796a870a81a508cec85962ed821c2abd40438eaee07135cb6dde0bd93e84a3ff709dfeaf26f7f79717197c80c3aad378d62b3e4b232f60c46b0151')

build() {
  mkdir -p $_pkgname-$_gitver/build
  cd $_pkgname-$_gitver/build

  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release

  make
}

package() {
  cd $_pkgname-$_gitver/build

  make DESTDIR="$pkgdir" install

  install -Dm 644 "$srcdir"/$_pkgname-$_gitver/LICENSE_1_0.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
}
